<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
	<head>
		<title>合格证管理-金融风险管理系统</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<script type="text/javascript">
		function jumpPage(page) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/releaseIndex.do?currentPage=" + page;
			searchForm.submit();
		}
		
		// 释放
		function release(id) {
			if(confirm("是否确认释放？")){
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/cm/release.do?currentPage=${currentPage}&id="+id;
				searchForm.submit();	
			}
			
		}
		
		function viewRelease(id) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/release/view.do?currentPage=${currentPage}&entity.id="+id;
			alert(searchForm.action );
			searchForm.submit();
		}
		function exportcf(){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/export.do?currentPage=${currentPage}";
			searchForm.submit();
		}
		
		function submit_query(){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/releaseIndex.do";
			searchForm.submit();
		}
		
		//合格证详情
		function cfView(id){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/cfView.do?currentPage=${currentPage}&id="+id;
			searchForm.submit();
		}
		function checkdate(start,end){   
		 //得到日期值并转化成日期格式，replace(/\-/g, "\/")是根据验证表达式把日期转化成长日期格式，这样
		 //再进行判断就好判断了
			var sDate = new Date(start.value.replace(/\-/g, "\/"));
		    var eDate = new Date(end.value.replace(/\-/g, "\/"));
		    if(sDate > eDate){
		    	alert("结束日期不能小于开始日期");
		    	end.value="";
		    	end.focus();
		    	return false;
		    }
		    return true;
		 }
		</script>
	</head>
	<body>
	<div class="navigation">
	    <span>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>合格证管理&gt;&gt;待释放合格证
    </div>
    
    <div class="xt_main_right_center">
      <form name="searchForm" id="searchForm" method="post" action="releaseIndex.do">
	      <table width="100%" border="0" cellpadding="0" cellspacing="0"  style="border-color:#CCCCCC;">
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;金融机构:&nbsp; </td>
	        	<td>
	           		<input type="text" class="input"  name='search.financial.name' value="<s:property value="search.financial.name"/>"  style='width:120px'/>
	            </td>
	            <td  class="left-td-width-bg">&nbsp;车架号:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.chassis'  class="input"  value="<s:property value="search.chassis"/>"  style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">&nbsp;入库时间:&nbsp;</td>
	            <td>
	            	<input name="search.warehouseDateBegin" id="warehouseDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.warehouseDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('warehouseDateEnd'))"/>
	            	至 <input name="search.warehouseDateEnd" id="warehouseDateEnd" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.warehouseDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('warehouseDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;渠道:&nbsp; </td>
	        	<td>
	           		<input type="text" name='search.brand.name'  class="input" value="<s:property value="search.brand.name"/>" style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">&nbsp;店名:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.shop.shopName' class="input"  value="<s:property value="search.shop.shopName"/>" style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">出门日:&nbsp;</td>
	            <td>
	            	<input name="search.goingOutDateBegin" id="goingOutDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.goingOutDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('goingOutDateEnd'),this)"/>
	            	至 <input name="search.goingOutDateEnd" id="goingOutDateEnd"  class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.goingOutDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('goingOutDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;合格证号:&nbsp; </td>
	        	<td>
	           		<input type="text" name='search.certificationNum'  class="input" value="<s:property value="search.certificationNum"/>" style='width:120px'/>
	            </td>
	           <td class="left-td-width-bg">&nbsp;店号:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.shop.shopMark' class="input"  value="<s:property value="search.shop.shopMark"/>" style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">预定到店日:&nbsp;</td>
	            <td>
	            	<input name="search.scheduledDateBegin" id="scheduledDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.scheduledDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('scheduledDateEnd'),this)"/>
	            	至 <input name="search.scheduledDateEnd" id="scheduledDateEnd" class="Wdate"  type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.scheduledDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('scheduledDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	            <td class="left-td-width-bg">申请出库时间:&nbsp;</td>
	            <td colspan="4">
	            	<input name="search.applyReleaseDateBegin" id="applyReleaseDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.applyReleaseDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('applyReleaseDateEnd'),this)"/>
	           		至 <input name="search.applyReleaseDateEnd" id="applyReleaseDateEnd" class="Wdate"  type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.applyReleaseDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('applyReleaseDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
			    <td height="28" colspan="6" align="right" style="border-bottom:none;">
			    	<input type="reset" value="" class="btn_clear_form" onclick="clearForm(this.form);return false;"/>
			    	<input name="" type="button" name="submit" value=""  class="btn_query" onclick="submit_query()"/>
			    	<input name="search.releaseOnly" type="hidden" value="1"/>
			    </td>
		    </tr>
	      </table>
      </form>
      </div>
      <br/>
      
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>合格证列表：</strong></font></td>
		    <td height="25" align="right">
            </td>
		  </tr>
		</table>
      
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
	  <tr> 
	    <td width="3%" class="top-td-width-bg">序号 </td>
	    <td width="5%" class="top-td-width-bg">店号</td>
	    <td width="6%" class="top-td-width-bg">店名</td>
	    <td width="6%" class="top-td-width-bg">车型</td>
	    <td width="8%" class="top-td-width-bg">合格证号</td>
	    <td width="8%" class="top-td-width-bg">车架号</td>
	    <td width="6%" class="top-td-width-bg">供货价</td>
	    <td width="6%" class="top-td-width-bg">订单号</td>
	    <td width="6%" class="top-td-width-bg">贷款品种号</td>
	    <td width="6%" class="top-td-width-bg">贷款起始日</td>
	    <td width="6%" class="top-td-width-bg">贷款到期日</td>
	    <td width="6%" class="top-td-width-bg">出门日</td>
	    <td width="6%" class="top-td-width-bg">预定到店日</td>
	    <td width="6%" class="top-td-width-bg">入库日期</td>
	    <td width="4%" class="top-td-width-bg">状态</td>
	    <td width="6%" class="top-td-width-bg">二网地址</td>
	    <td width="6%" class="top-td-width-bg">操作</td>
	  </tr>
	 <s:iterator value="page.result" status="st" id="cm">
	 <s:if test="change&&search.change">
		<tr height="26" align="center" bgcolor="#F7F709">
	</s:if>
	<s:else>
		<tr height="26" align="center" bgcolor="#FFFFFF">
	</s:else>
			<td align="center"><s:property value="#st.index+1"/>
			</td>
		    <td align="center"><s:property value="shop.shopMark"/></td>
		    <td align="center"><s:property value="shop.shopName"/></td>
		    <td align="center"><s:property value="motorcycleType"/></td>
		    <td align="center"><s:property value="certificationNum"/></td>
		    <td align="center"><s:property value="chassis"/></td>
		    <td align="center"><s:property value="formatAmount(supplyPrice)"/></td>
		    <td align="center"><s:property value="orderNumber"/></td>
		    <td align="center"><s:property value="draft"/></td>
		    <td align="center"><s:date name="draftBeginDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:date name="draftEndDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:date name="goingOutDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:date name="scheduledDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:date name="warehouseDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:if test="theAddress!=null&&state.index==2">在库(二网)</s:if><s:else><s:property value="state.name" /></s:else></td>
		    <td align="center"><s:property value="theAddress"/></td>
			<td align="center">
				<jysz:permission code="CM_TORELEASE_VIEW">
					<a href="javascript:cfView(<s:property value="id"/>)"><img src="${contextPath}/images/chakan.gif" alt="详情" width="16" height="18" border="0" /></a>
				</jysz:permission>
		    	<s:if test="state.index!=5">
		    		<jysz:permission code="CM_TORELEASE_RELEASE">
					<a href="javascript:release(<s:property value="id"/>);"><img src="${contextPath}/images/release.png" alt="确认释放" border="0" /></a>
				</jysz:permission>
				</s:if>
		   		<a href="<s:property value='contextPath'/>/cm/release/view.do?currentPage=${currentPage}&entity.id=<s:property value="release.id"/>"><img src="${contextPath}/images/lianjie.png" alt="链接到申请批次" border="0" /></a>
		  </td>
		</tr>
	</s:iterator>
	<tr bgcolor="#F9FCEF"> 
	 <td height="36" colspan="17" align="center">
			<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
	 </td>
	</tr>
	</table>

		<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
	</body>
</html>